package ar.gov.hackaton.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "Poblacion")
public class Poblacion implements Serializable {

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((departamentoId == null) ? 0 : departamentoId.hashCode());
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((mujeres == null) ? 0 : mujeres.hashCode());
		result = prime * result + ((provinciaId == null) ? 0 : provinciaId.hashCode());
		result = prime * result + ((total == null) ? 0 : total.hashCode());
		result = prime * result + ((varones == null) ? 0 : varones.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Poblacion other = (Poblacion) obj;
		if (departamentoId == null) {
			if (other.departamentoId != null)
				return false;
		} else if (!departamentoId.equals(other.departamentoId))
			return false;
		if (getId() == null) {
			if (other.getId() != null)
				return false;
		} else if (!getId().equals(other.getId()))
			return false;
		if (mujeres == null) {
			if (other.mujeres != null)
				return false;
		} else if (!mujeres.equals(other.mujeres))
			return false;
		if (provinciaId == null) {
			if (other.provinciaId != null)
				return false;
		} else if (!provinciaId.equals(other.provinciaId))
			return false;
		if (total == null) {
			if (other.total != null)
				return false;
		} else if (!total.equals(other.total))
			return false;
		if (varones == null) {
			if (other.varones != null)
				return false;
		} else if (!varones.equals(other.varones))
			return false;
		return true;
	}

	private static final long serialVersionUID = -4007478336014625895L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Column
	private Long provinciaId;
	@Column
	private Long departamentoId;
	@Column
	private Long varones;
	@Column
	private Long mujeres;
	@Column
	private Long total;

	public Long getProvinciaId() {
		return provinciaId;
	}

	public void setProvinciaId(Long provinciaId) {
		this.provinciaId = provinciaId;
	}

	public Long getDepartamentoId() {
		return departamentoId;
	}

	public void setDepartamentoId(Long departamentoId) {
		this.departamentoId = departamentoId;
	}

	public Long getVarones() {
		return varones;
	}

	public void setVarones(Long varones) {
		this.varones = varones;
	}

	public Long getMujeres() {
		return mujeres;
	}

	public void setMujeres(Long mujeres) {
		this.mujeres = mujeres;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
